package com.hmsproject.search.managedbean;

import java.util.List;

import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.SessionScoped;
import javax.faces.bean.ViewScoped;

import com.hmsproject.datastructures.transactions.Transaction;
import com.hmsproject.db.inmemorydb.DealMap;
import com.hmsproject.db.inmemorydb.TransactionMap;


@ViewScoped
@ManagedBean
public class DealTransaction {
	
	@ManagedProperty(value="#{dealView}")
	private DealView dealView;
	
	List<Transaction> dealTransactions;

	public DealView getDealView() {
		return dealView;
	}

	public void setDealView(DealView dealView) {
		this.dealView = dealView;
	}

	public List<Transaction> getDealTransactions() {
		return dealTransactions;
	}

	public void setDealTransactions(List<Transaction> dealTransactions) {
		this.dealTransactions = dealTransactions;
	}
	
	@PostConstruct
	private void init(){
		this.dealTransactions = TransactionMap.INSTANCE.getTransactionListForDeal(this.dealView.getDealId());
	}
	
	

}
